<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

	<h:head>
		<title>Election Result</title>
	</h:head>
	<h:body>
	<ui:include src="/horizontal_menu.xhtml">
	</ui:include>
		<h:form>
				 <p:dataTable var="o" value="#{electionResultBean.partydetails}"  paginator="true" rows="10">
				<!-- selection="#{tableBean.selectedCar}" <p:ajax event="rowSelect" update=":form:display" oncomplete="carDialog.show()" />-->

                <f:facet name="header">
                    List of parties voted for
                </f:facet>

                <p:column headerText="Name" id="name">
                    #{o.party.name}
                </p:column>

                <p:column headerText="NumberOfVotes" id="NumberofVotes">
                    #{o.partycount}
                </p:column>
                
            </p:dataTable>
		</h:form>
		<br/>
		<h:form>
				 <p:dataTable var="m" value="#{electionResultBean.memberdetails}"  paginator="true" rows="10">
				<!-- selection="#{tableBean.selectedCar}" <p:ajax event="rowSelect" update=":form:display" oncomplete="carDialog.show()" />-->

                <f:facet name="header">
                    List of parties voted for
                </f:facet>

                <p:column headerText="Name" id="name">
                    #{m.member.name}
                </p:column>

                <p:column headerText="Surname" id="surname">
                    #{m.member.surname}
                </p:column>

                <p:column headerText="#OfVotesAs(P1)" id="NumberofVotes_P1">
                    #{m.p1_count}
                </p:column>
                
                <p:column headerText="#OfVotesAs(P2)" id="NumberofVotes_P2">
                    #{m.p2_count}
                </p:column>
                
                <p:column headerText="#OfVotesAs(P3)" id="NumberofVotes_P3">
                    #{m.p3_count}
                </p:column>
                
            </p:dataTable>
		</h:form>
		
	</h:body>
</html>